package com.student.system.controller;

import com.student.system.service.TeacherService;
import com.student.system.service.impl.TeacherServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;

@WebServlet("/teacher/*")
public class TeacherServlet extends BaseServlet{
    private TeacherService teacherService = new TeacherServiceImpl();
    //注册
    public void doRegister(HttpServletRequest req, HttpServletResponse resp){
        teacherService.doRegister(req,resp);
    }
    //添加信息
    public void doMessage(HttpServletRequest req, HttpServletResponse resp){
        teacherService.doMessage(req,resp);
    }
    //登录验证
    public void doLogin(HttpServletRequest req, HttpServletResponse resp){
        teacherService.doLogin(req,resp);
    }
    //用户Id是否存在
    public void checkLoginId(HttpServletRequest req, HttpServletResponse resp){
        teacherService.checkLoginId(req,resp);

    }
    //学生信息
    public void studentMessage(HttpServletRequest req, HttpServletResponse resp){
        teacherService.message(req,resp);
    }
//    public void MyMessage(HttpServletRequest req, HttpServletResponse resp) throws ServletException, SQLException, IOException {
//        teacherService.MyMessage(req,resp);
//    }
    public void saveMyMessage(HttpServletRequest req, HttpServletResponse resp) throws SQLException, IOException {
        teacherService.saveMyMessage(req,resp);
    }
    //本人信息展示
    public void MyMessage(HttpServletRequest req, HttpServletResponse resp) throws ServletException, SQLException, IOException {
        teacherService.MyMessage(req,resp);
    }
    //学生成绩
    public void StudentScore(HttpServletRequest req, HttpServletResponse resp) throws ServletException, SQLException, IOException {
        teacherService.StudentScore(req,resp);
    }
    //学生成绩表展示
    public  void doStudentScoreEdit(HttpServletRequest req, HttpServletResponse resp) throws SQLException, IOException {
        teacherService.doEditStudentScore(req,resp);
    }
    //学生成绩表编辑
    public void StudentScoreMessage(HttpServletRequest req, HttpServletResponse resp){
        teacherService.StudentScoreMessage(req,resp);
    }
    //添加用户
    public void doAddStudentMessage(HttpServletRequest req, HttpServletResponse resp) throws SQLException, IOException {
        teacherService. doAddStudentMessage(req,resp);
    }
    //删除用户
    public void deleteStudentMessage(HttpServletRequest req, HttpServletResponse resp) throws SQLException, IOException {
        teacherService.deleteStudentMessage(req,resp);

    }
}
